package com.sykj.util.reponse;

import lombok.Getter;
import lombok.NoArgsConstructor;

/**
 * @program: BeautyClub
 * @description: 响应数据基类
 * @author: qiaoli
 * @create: 2020-07-15 09:14
 */
@Getter
@NoArgsConstructor
public class BaseResponse {
    /**
     * 响应代码
     */
    private String code;

    /**
     * 响应消息
     */
    private String message;

    /**
     * 响应结果
     */
    private Object data;


    public BaseResponse(Object data) {
        this(CommonEnum.SUCCESS, data);
    }

    public BaseResponse(String code,String message,Object data) {
        this.code = code;
        this.message = message;
        this.data = data;
    }

    public BaseResponse(String code,String message) {
        this.code = code;
        this.message = message;
    }

    public BaseResponse(CommonEnum success, Object data) {
        this.code = success.getResultCode();
        this.message = success.getResultMsg();
        this.data = data;
    }

    public BaseResponse(CommonEnum success) {
        this.code = success.getResultCode();
        this.message = success.getResultMsg();
    }
}
